package com.kcwl.carrier.infrastructure.enums;

import lombok.Getter;

@Getter
public enum CarrierInfoEnums {

    YES(1, "是"),
    NO(0, "否");

    private int     code;
    private String  value;

    CarrierInfoEnums(int code, String value) {
        this.code  = code;
        this.value = value;
    }

    public static String getDesc(int code){

        for(CarrierInfoEnums aase : values()){
            if(aase.getCode() == code){
                return aase.getValue();
            }
        }
        return null;
    }

    @Getter
    public enum RoleEnum{
        DRIVER(1, "司机"),
        CAR_CAPTAIN(3, "车队长");

        private int code;
        private String  value;

        RoleEnum(int code, String value) {
            this.code  = code;
            this.value = value;
        }

        public static String getDesc(int code){

            for(RoleEnum sourceEnum : values()){
                if(sourceEnum.getCode() == code){
                    return sourceEnum.getValue();
                }
            }
            return null;
        }
    }

    @Getter
    public static enum UserTagEnum{
        TEST(1, "测试"),
        INNER(2, "内部"),
        REAL(3,"真实");

        private int code;
        private String  value;

        UserTagEnum(int code, String value) {
            this.code  = code;
            this.value = value;
        }

        public static String getDesc(int code){

            for(UserTagEnum sourceEnum : values()){
                if(sourceEnum.getCode() == code){
                    return sourceEnum.getValue();
                }
            }
            return null;
        }
    }
    @Getter
    public enum AuthenticationStatusEnum{
        //未认证_0,待审核_1,已认证_2,已驳回_3',
        UNVERIFIED(0, "未认证"),
        PENDING_REVIEW(1, "待审核"),
        VERIFIED(2, "已认证"),
        REJECT(3, "已驳回");

        private int code;
        private String  value;

        AuthenticationStatusEnum(int code, String value) {
            this.code  = code;
            this.value = value;
        }

        public static String getDesc(int code){
            for(AuthenticationStatusEnum sourceEnum : values()){
                if(sourceEnum.getCode() == code){
                    return sourceEnum.getValue();
                }
            }
            return "未知";
        }
    }

    @Getter
    public enum LoginSourceEnum{
        /*OLD_KCWL(0, "旧版快成"),
        NEW_KCWL(1, "重构快成"),
        JL_KCWL(2, "建龙司机app");*/
        OLD_KCWL(0, "100","旧版司机app"),
        JL_KCWL(1, "204","建龙司机app"),
        NEW_KCWL(2, "200","重构司机app");

        private int code;
        private String platformCode;
        private String  value;

        LoginSourceEnum(int code, String platformCode,String value) {
            this.code  = code;
            this.platformCode  = platformCode;
            this.value = value;
        }

        public static String getDesc(int code){

            for(LoginSourceEnum sourceEnum : values()){
                if(sourceEnum.getCode() == code){
                    return sourceEnum.getValue();
                }
            }
            return null;
        }

        public static Integer getCode(String platformCode){

            for(LoginSourceEnum sourceEnum : values()){
                if(sourceEnum.getPlatformCode().equals(platformCode)){
                    return sourceEnum.getCode();
                }
            }
            return null;
        }
    }

    public enum CarrierDriverInviteStatus {
        //邀请类型：1车队长邀请司机加入车队，2司机申请加入车队
        //邀请状态：10司机通过11司机拒绝12待司机确认20车队长通过21车队长拒绝22待车队长确认
        OLD(0, "老数据"),
        DRIVER_YES(10, "司机通过"),
        DRIVER_NO(11, "司机拒绝"),
        DRIVER_WAIT(12, "待司机确认"),
        CAROWNER_NO(21, "车队长拒绝"),
        CAROWNER_YES(20, "车队长通过"),
        CAROWNER_WAIT(22, "待车队长确认");

        private int code;
        private String value;

        CarrierDriverInviteStatus(int code, String value){
            this.code = code;
            this.value = value;
        }

        public int getCode() {
            return this.code;
        }
        public String getValue() {
            return this.value;
        }
    }

    public enum CarrierDriverInviteType {
        OLD(0, "老数据"),
        CAROWNER(1, "车队长邀请司机加入车队"),
        DRIVER(2, "司机申请加入车队");
        //邀请类型：1车队长邀请司机加入车队，2司机申请加入车队

        private Integer code;
        private String value;

        CarrierDriverInviteType(Integer code, String value){
            this.code = code;
            this.value = value;
        }

        public Integer getCode() {
            return this.code;
        }
        public String getValue() {
            return this.value;
        }
    }

    @Getter
    public enum RegisterSourceEnum{
        OLD_KCWL(0, "100","旧版快成"),
        JL_KCWL(1, "204","建龙快成"),
        NEW_KCWL(2, "200","重构快成");

        private int code;
        private String platformCode;
        private String  value;

        RegisterSourceEnum(int code, String platformCode,String value) {
            this.code  = code;
            this.platformCode  = platformCode;
            this.value = value;
        }

        public static String getDesc(int code){

            for(RegisterSourceEnum sourceEnum : values()){
                if(sourceEnum.getCode() == code){
                    return sourceEnum.getValue();
                }
            }
            return null;
        }

        public static Integer getCode(String platformCode){

            for(RegisterSourceEnum sourceEnum : values()){
                if(sourceEnum.getPlatformCode().equals(platformCode)){
                    return sourceEnum.getCode();
                }
            }
            return null;
        }
    }

    @Getter
    public enum InviteStatus {
        PENDING(0, "待确认"),
        PASSED(1, "确认通过的"),
        LIFTED(2, "已解除的");

        private int code;
        private String value;

        InviteStatus(int code, String value){
            this.code = code;
            this.value = value;
        }

        public int getCode() {
            return this.code;
        }
        public String getValue() {
            return this.value;
        }
    }
}
